<!--<template>
  <div class="app-container">
    <router-view />
  </div>
</template>

<script setup lang="ts">

</script>

<style scoped>
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
</style>-->

<template>
  <div class="app-container">
    <!-- 左侧边栏 -->
    <Sidebar />
    
    <!-- 主体聊天区域 -->
    <div class="main-content">
      <!-- 聊天头部 -->
      <ChatHeader />
      
      <!-- 聊天窗口 -->
      <ChatWindow />
      
      <!-- 输入区 -->
      <chatInput/>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue';
import Sidebar from './components/Sidebar.vue';
import ChatHeader from './components/Header.vue';
import ChatWindow from './components/Window.vue';
import chatInput from './components/Input.vue';

export default defineComponent({
  name: 'App',
  components: {
    Sidebar,
    ChatHeader,
    ChatWindow,
    chatInput
  },
  setup() {
    const message = ref('');
    const messages = ref([
      { id: 1, text: "Hello! I'm Claude, an AI assistant created by Anthropic.", sender: 'Claude' },
      { id: 2, text: "How can I help you today?", sender: 'Claude' },
    ]);

    const sendMessage = () => {
      if (message.value.trim()) {
        messages.value.push({
          id: messages.value.length + 1,
          text: message.value,
          sender: 'User',
        });
        message.value = ''; // 清空输入框
      }
    };

    return {
      message,
      messages,
      sendMessage,
    };
  },
});
</script>

<style scoped>
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: calc(100% - 250px);
}

.chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: #222;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

</style>

